home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / libexif / exif-log.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-06-13  |  2.3 KB  |  76 lines

  1. /*! \file exif-log.h
  2.  *  \brief log message infrastructure
  3.  *
  4.  * Copyright ⌐ 2004 Lutz Mⁿller <lutz@users.sourceforge.net>
  5.  *
  6.  * This library is free software; you can redistribute it and/or
  7.  * modify it under the terms of the GNU Lesser General Public
  8.  * License as published by the Free Software Foundation; either
  9.  * version 2 of the License, or (at your option) any later version.
  10.  *
  11.  * This library is distributed in the hope that it will be useful, 
  12.  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
  13.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  * Lesser General Public License for more details. 
  15.  *
  16.  * You should have received a copy of the GNU Lesser General Public
  17.  * License along with this library; if not, write to the
  18.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19.  * Boston, MA 02111-1307, USA.
  20.  */
  21.  
  22. #ifndef __EXIF_LOG_H__
  23. #define __EXIF_LOG_H__
  24.  
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif /* __cplusplus */
  28.  
  29. #include <libexif/exif-mem.h>
  30. #include <stdarg.h>
  31.  
  32. typedef struct _ExifLog        ExifLog;
  33.  
  34. ExifLog *exif_log_new     (void);
  35. ExifLog *exif_log_new_mem (ExifMem *);
  36. void     exif_log_ref     (ExifLog *log);
  37. void     exif_log_unref   (ExifLog *log);
  38. void     exif_log_free    (ExifLog *log);
  39.  
  40. typedef enum {
  41.     EXIF_LOG_CODE_NONE,
  42.     EXIF_LOG_CODE_DEBUG,
  43.     EXIF_LOG_CODE_NO_MEMORY,
  44.     EXIF_LOG_CODE_CORRUPT_DATA
  45. } ExifLogCode;
  46. const char *exif_log_code_get_title   (ExifLogCode); /* Title for dialog   */
  47. const char *exif_log_code_get_message (ExifLogCode); /* Message for dialog */
  48.  
  49. /** Log callback function prototype.
  50.  */
  51. typedef void (* ExifLogFunc) (ExifLog *log, ExifLogCode, const char *domain,
  52.                   const char *format, va_list args, void *data);
  53.  
  54. /** Register log callback function.
  55.  */
  56. void     exif_log_set_func (ExifLog *log, ExifLogFunc func, void *data);
  57.  
  58. void     exif_log  (ExifLog *log, ExifLogCode, const char *domain,
  59.             const char *format, ...)
  60. #ifdef __GNUC__
  61.             __attribute__((__format__(printf,4,5)))
  62. #endif
  63. ;
  64.  
  65. void     exif_logv (ExifLog *log, ExifLogCode, const char *domain,
  66.             const char *format, va_list args);
  67.  
  68. /* For your convenience */
  69. #define EXIF_LOG_NO_MEMORY(l,d,s) exif_log (l, EXIF_LOG_CODE_NO_MEMORY, d, "Could not allocate %i byte(s).", s)
  70.  
  71. #ifdef __cplusplus
  72. }
  73. #endif /* __cplusplus */
  74.  
  75. #endif /* __EXIF_LOG_H__ */
  76.